cmake_minimum_required(VERSION 3.10)

set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
include(cotire)

project(CRFoundation)

add_definitions(-std=c++11)

set(LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)

link_directories(${LIBRARY_OUTPUT_DIRECTORY})

find_package(CURL)

if(NOT CURL_FOUND)
    if(MSVC)
        include_directories(${CMAKE_SOURCE_DIR}/vendor/include)
        link_directories(${CMAKE_SOURCE_DIR}/vendor/lib)
    else()
        add_subdirectory(${CMAKE_SOURCE_DIR}/vendor/curl-master)
    endif(MSVC)
else()
    include_directories(${CURL_INCLUDE_DIRS})
    link_directories(${CURL_LIBRARIES})
endif(NOT CURL_FOUND)


include_directories(${CMAKE_CURRENT_SOURCE_DIR}/CRFoundation)

add_subdirectory(CRFoundation)
add_subdirectory(test)